# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=py3-pyzabbix
pkgver=1.3.1
pkgrel=1
pkgdesc="Library to interact with the Zabbix API"
url="https://github.com/lukecyca/pyzabbix"
arch="noarch"
license="LGPL-2.1-or-later"
depends="python3 py3-requests py3-semantic-version"
makedepends="python3-dev py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-httpretty py3-requests-mock"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/lukecyca/pyzabbix/archive/$pkgver.tar.gz"
builddir="$srcdir/${pkgname#py3-}-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -v tests
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
eb49964d7265dcc650f01c3b2ff3fcee9567c6def3471a6c8981a523de7791f00cf7f049b11daf2aab19af626682f9ff60ae9d7cc71d9b4c3b97149edbfa8840  py3-pyzabbix-1.3.1.tar.gz
"
